#ifndef GLRENDERTEXTURE_H
#define GLRENDERTEXTURE_H

#include "RenderTexture.h"
#include "GL/OpenGL.h"

NS_B2D_BEGIN

///
///	RenderTexture
/// render to an arbitrary number of textures
///
class GLRenderTexture
	: public RenderTexture
{
private:
	struct TempEditBind;

	GLuint mFBO;

public:
	GLRenderTexture(size_t texCount);
	virtual ~GLRenderTexture(void);


	void* getRTHandle(void) const { return reinterpret_cast<void*>(mFBO); }

private:
	void resizeImpl(void);

	/// Create FBO & textures and bind them
	void create(void);
	/// Destroy FBO and release textures
	void destroy(void);
};

NS_B2D_END

#endif
